<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>插槽的基本使用</title>
</head>

<body>
  <div id="app">
    <cpn></cpn>
    <cpn>
      <h1>1</h1>
      <span>2</span>
      <i>3</i>
    </cpn>
  </div>

  <template id="cpn">
    <div>
      <h3>插槽的基本使用</h3>
      <p>我是组件的模板</p>
      <slot><button>点击</button></slot>
    </div>
  </template>

  <script src="../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        Msg: 'Vue.js'
      },
      components: {
        cpn: {
          template: '#cpn'
        }
      }
    })
  </script>
</body>

</html>